import unittest
from homework.testHomework import TestStringTool
from test.HTMLTestRunner import HTMLTestRunner

if __name__=="__main__":
    suite = unittest.TestSuite()
    suite.addTest(TestStringTool("test_upper"))
    suite.addTest(TestStringTool("test_title"))
    suite.addTest(TestStringTool("test_index"))
    suite.addTest(TestStringTool("test_name"))

    # runner = unittest.TextTestRunner(verbosity=2)
    # runner.run(suite)

    #使用HTMLTestRunner 生成html 报告
    with open("report.html","wb") as f:
        HTMLTestRunner(
            stream=f,
            title="测试字符串工具",
            description="xts的测试报告",
            verbosity=2
        ).run(suite)